 <template>
  <div class="relatedMvRoot">
    <div class="title">
      相关推荐
    </div>
    <div class="itemVideo" v-for="(v,i) in relatedMvList" :key="i" @click='handleItemVideoClick(v.vid)'>
      <div class="videoCover">
        <img :src="`${v.coverUrl}?param=300y300`" alt="">
        <div class="playCount">
          <i class="iconfont icon-shipin"></i>{{v.playTime}}
        </div>
        <div class="videoTime">
          {{v.durationms}}
        </div>
      </div>
      <div class="desc">
        <div class="descTitle">{{v.title}}</div>
        <div class="creator">{{v.creator[0].userName}}</div>
      </div>
    </div>
  </div>
</template>
 
 <script>
export default {
  props: {
    relatedMvList: {
      type: Array,
      default() {
        return []
      }
    }
  },
  setup(p, { emit }) {
    const handleItemVideoClick = vid => {
      emit('relatedMvClick', vid)
    }
    return {
      handleItemVideoClick
    }
  }
}
</script>
 
 <style scoped>
.title {
  margin: 10px 0;
  color: black;
  font-weight: 600;
}
.itemVideo {
  display: flex;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 12px;
}
.videoCover {
  position: relative;
  margin-right: 10px;
  width: 150px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
}
.videoCover i {
  font-size: 12px;
}
.videoCover img {
  width: 100%;
  /* height: 100%; */
}
.desc {
  width: 140px;
  margin: 12px 0;
}
.descTitle {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.playCount {
  position: absolute;
  display: flex;
  align-items: center;
  right: 5px;
  top: 5px;
}
.videoTime {
  position: absolute;
  bottom: 5px;
  right: 5px;
}
.creator {
  color: gray;
  margin-top: 15px;
}
</style>